package com.xindz.cn.mvptest.components.product.persenter;

import com.avos.avoscloud.AVException;
import com.avos.avoscloud.FindCallback;
import com.xindz.cn.mvptest.base.BasePresenter;
import com.xindz.cn.mvptest.components.product.data.ProductBean;
import com.xindz.cn.mvptest.components.product.model.ProductModel;
import com.xindz.cn.mvptest.components.product.view.ProductShowView;

import java.util.List;

/**
 * @name MvpTest
 * @class name：com.xindz.cn.mvptest.components.product.persenter
 * @describe describe
 * @anthor XINDZ
 * @time 2017/10/31 13:44
 * @change
 * @chang time
 * @class describe
 */
public class ProductShowPersenter extends BasePresenter<ProductShowView> {
    private ProductModel productModel;

    public ProductShowPersenter() {
        this.productModel = new ProductModel();
    }

    public void showProduct() {
        productModel.findInBackground(new FindCallback<ProductBean>() {
            @Override
            public void done(List<ProductBean> list, AVException e) {
                getView().loadData(list, e);
            }
        });
    }
}
